/**
 * 表单相关监听事件
 */
import Vue from "vue";
import formRule from "./formRule";
import { Toast, Dialog } from "vant";
import _http from "../../../api/http";
import {photoCompress} from "../common/photoCompress";

Vue.use(Toast);
Vue.use(Dialog);
//表单监听
//监听残疾人情况变化
function onChangePstate(vue, data) {
  if (data !== "6") {
    formRule.disPstate(vue);
  }
  if (data === "6") {
    formRule.enablePstate(vue);
  }
}
//r3.户口性质
function onChangeHouseholdType(vue, data) {
  if (!formRule.isLiveNursing(vue)) {
    formRule.initEconomic(vue); //经济与住房模块
    reloadEconomic(vue);
  }
  formRule.initSocialAssist(vue); //社会救助
  formRule.initHouseholder(vue); //户主和户主身份证号
  reload(vue, [
    vue.element.view_socialAssist,
    vue.element.view_hostName,
    vue.element.view_hostIdentityCard
  ]);
}
//r7.监听是否在养老院居住
function onChangeNursingHouse(vue, data) {
  if (data == "1") {
    formRule.disNonNursing(vue);
    formRule.initSocialSecurity(vue);
    formRule.initHealth(vue);
    reloadSocialSecurity(vue);
    reloadHealth(vue);
  } else {
    formRule.enableNursing(vue);
    formRule.initEconomic(vue); //初始化经济
    if (formRule.isEnableJob(vue)) {
      formRule.initJob(vue); //就业扶贫模块
      reloadJob(vue);
    }
    formRule.initSocialSecurity(vue); //社会保障模块
    if (formRule.isEnableSports(vue)) {
      formRule.initInactivityReason(vue); //不经常参加文化体育的原因
      reload(vue, vue.element.view_inactivityReason);
    }
    formRule.initHouseholder(vue); //初始化户主和身份证号
    reloadEconomic(vue);
    reloadSocialSecurity(vue);
    reload(vue, [vue.element.view_hostName, vue.element.view_hostIdentityCard]);
  }
}
//r4.婚姻状况
function onConfirmMarriage(vue, data) {
  vue.formData.marriage.text = data.text;
  vue.formData.marriage.value = data.value;
  vue.marriagePicker = false;
}

//r8.非农业家庭收入状况
function onConfirmNonfarmEconomy(vue, data) {
  vue.formData.nonfarmEconomy.text = data.text;
  vue.formData.nonfarmEconomy.value = data.value;
  vue.nonfarmEconomyPicker = false;
  formRule.initSocialAssist(vue);
  reload(vue, vue.element.view_socialAssist);
}

//r9.非农业家庭住房状况
function onConfirmNonfarmHousing(vue, data) {
  vue.formData.nonfarmHousing.text = data.text;
  vue.formData.nonfarmHousing.value = data.value;
  vue.nonfarmHousingPicker = false;
}

//r10.农业贫困与建档立卡状况
function onConfirmFarmEconomy(vue, data) {
  vue.formData.farmEconomy.text = data.text;
  vue.formData.farmEconomy.value = data.value;
  vue.farmEconomyPicker = false;
  formRule.initSocialAssist(vue);
  reload(vue, vue.element.view_socialAssist);
}

//r11.农业家庭住房状况
function onConfirmFarmHousing(vue, data) {
  vue.formData.farmHousing.text = data.text;
  vue.formData.farmHousing.value = data.value;
  vue.farmHousingPicker = false;
  formRule.initSocialAssist(vue);
  reload(vue, vue.element.view_socialAssist);
}
//r12.是否识字
function onConfirmLiteracy(vue, data) {
  formRule.initEducation(vue);
  formRule.initSchool(vue);
  formRule.initNotEnrolledReason(vue);
  if (formRule.isEnableJob(vue)) {
    formRule.initJob(vue); //就业扶贫模块
    reloadJob(vue);
  }
  formRule.initSocialSecurity(vue); //社会保障模块
  //重新渲染选择器
  reload(vue, [
    vue.element.view_education,
    vue.element.view_generalSchool,
    vue.element.view_specialSchool,
    vue.element.view_notEnrolledReason
  ]);
  reloadSocialSecurity(vue);
}
//r13.受教育程度
function onConfirmEducation(vue, data) {
  let element = vue.element;
  vue.formData.education.text = data.text;
  vue.formData.education.value = data.value;
  vue.educationPicker = false;
  formRule.initSchool(vue);
  formRule.initNotEnrolledReason(vue);
  reload(vue, [vue.element.view_generalSchool, vue.element.view_specialSchool]);
  reload(vue, vue.element.view_notEnrolledReason);
  if (formRule.isEnableJob(vue)) {
    formRule.initJob(vue); //就业扶贫模块
    reloadJob(vue);
  }
  formRule.initSocialSecurity(vue); //社会保障模块
  reloadSocialSecurity(vue);
}
//r14.就读学校-普通
function onConfirmGeneralSchool(vue, data) {
  if (data.value) {
    vue.formData.generalSchool.text = data.text;
    vue.formData.generalSchool.value = data.value;
    vue.formData.specialSchool.text = "";
    vue.formData.specialSchool.value = "";
  } else {
    vue.formData.generalSchool.text = "";
    vue.formData.generalSchool.value = "";
  }
  vue.generalSchoolPicker = false;
  formRule.initSchool(vue);
  formRule.initNotEnrolledReason(vue);
  if (formRule.isEnableJob(vue)) {
    formRule.initJob(vue); //就业扶贫模块
    reloadJob(vue);
  }
  formRule.initSocialSecurity(vue); //社会保障模块
  reload(vue, vue.element.view_notEnrolledReason);
  reloadSocialSecurity(vue);
}

//r14.就读学校-特殊
function onConfirmSpecialSchool(vue, data) {
  if (data.value) {
    vue.formData.specialSchool.text = data.text;
    vue.formData.specialSchool.value = data.value;
    vue.formData.generalSchool.text = "";
    vue.formData.generalSchool.value = "";
  } else {
    vue.formData.specialSchool.text = "";
    vue.formData.specialSchool.value = "";
  }
  vue.specialSchoolPicker = false;
  formRule.initSchool(vue);
  formRule.initNotEnrolledReason(vue);
  if (formRule.isEnableJob(vue)) {
    formRule.initJob(vue); //就业扶贫模块
    reloadJob(vue);
  }
  formRule.initSocialSecurity(vue); //社会保障模块
  reload(vue, vue.element.view_notEnrolledReason);
  reloadSocialSecurity(vue);
}

//r15.未入学原因
function onConfirmNotEnrolledReason(vue, data) {
  vue.formData.notEnrolledReason.text = data.text;
  vue.formData.notEnrolledReason.value = data.value;
  vue.notEnrolledReasonPicker = false;
}
//r16.是否就业
function onConfirmEmploy(vue, data) {
  let element = vue.element;
  formRule.initJob(vue); //就业扶贫模块
  formRule.initSocialSecurity(vue); //社会保障模块
  reload(vue, [
    element.view_employType,
    element.view_unemployedIncome,
    element.view_unemployedReason,
    element.view_employAssist,
    element.view_employAssistNeed
  ]);
  reloadSocialSecurity(vue);
}
//r17.残疾人就业形式
function onConfirmEmployType(vue, data) {
  let element = vue.element;
  vue.formData.employType.text = data.text;
  vue.formData.employType.value = data.value;
  vue.employTypePicker = false;
  formRule.initSocialInsurance(vue); //社会职工保险
  reload(vue, element.view_socialInsurance);
}

//r18.未就业主要生活来源
function onConfirmUnemployedIncome(vue, data) {
  vue.formData.unemployedIncome.text = data.text;
  vue.formData.unemployedIncome.value = data.value;
  vue.unemployedIncomePicker = false;
  formRule.initUnemployedIncome(vue);
  reload(vue, vue.element.view_unemployedIncome);
}

//r19.未就业主要原因
function onConfirmUnemployedReason(vue, data) {
  vue.formData.unemployedReason.text = data.text;
  vue.formData.unemployedReason.value = data.value;
  vue.unemployedReasonPicker = false;
  formRule.initUnemployedReason(vue);
  formRule.initEmployAssist(vue);
  formRule.initEmployAssistNeed(vue);
  let element = vue.element;
  reload(vue, [element.view_employAssist, element.view_employAssistNeed]);
}
//r22.职工社会保险
function onConfirmSocialInsurance(vue) {
  formRule.initSocialInsurance(vue); //社会职工保险
  formRule.initEndowmentInsurance(vue); //居民养老保险
  formRule.initEndowmentSubsidy(vue); //居民养老补贴
  formRule.initMedicalInsurance(vue); //居民医疗保险
  formRule.initMedicalSubsidy(vue); //居民医疗补贴
  formRule.initSocialAssist(vue); //社会救助
  let element = vue.element;
  reload(vue, [
    element.view_endowmentInsurance,
    element.view_endowmentSubsidy,
    element.view_medicalInsurance,
    element.view_medicalSubsidy,
    element.view_socialAssist
  ]);
}
//r23.居民养老保险
function onConfirmEndowmentInsurance(vue, data) {
  formRule.initEndowmentInsurance(vue);
  formRule.initEndowmentSubsidy(vue);
  reload(vue, vue.element.view_endowmentSubsidy);
}
//r25.居民医疗保险
function onConfirmMedicalInsurance(vue, data) {
  formRule.initMedicalSubsidy(vue);
  formRule.initSocialAssist(vue);
  reload(vue, [vue.element.view_medicalSubsidy, vue.element.view_socialAssist]);
}
//r26.居民医疗保险补贴
function onConfirmMedicalSubsidy(vue, data) {
  formRule.initSocialAssist(vue);
  reload(vue, vue.element.view_socialAssist);
}
//r27.社会救助
function onConfirmSocialAssist(vue) {
  formRule.initSocialAssist(vue);
  formRule.initSocialWelfare(vue);
  formRule.initFoster(vue);
  formRule.initFosterNeed(vue);
  formRule.initRehabilitation(vue);
  formRule.initNoRehabilitationReason(vue);
  formRule.initRehabilitationNeed(vue);
  reload(vue, [
    vue.element.view_socialWelfare,
    vue.element.view_foster,
    vue.element.view_fosterNeed
  ]);
  reloadHealth(vue);
}
//r28.社会福利补贴
function onConfirmSocialWelfare(vue) {
  formRule.initSocialWelfare(vue);
  formRule.initFoster(vue);
  formRule.initFosterNeed(vue);
  formRule.initRehabilitation(vue);
  formRule.initNoRehabilitationReason(vue);
  formRule.initRehabilitationNeed(vue);
  reload(vue, [vue.element.view_foster, vue.element.view_fosterNeed]);
  reloadHealth(vue);
}
//r29.托养服务
function onConfirmFoster(vue, data) {
  formRule.initFosterNeed(vue);
  reload(vue, vue.element.view_fosterNeed);
}
//r30.目前托养服务需求
function onConfirmFosterNeed(vue, data) {
  vue.formData.fosterNeed.text = data.text;
  vue.formData.fosterNeed.value = data.value;
  vue.fosterNeedPicker = false;
}
//r32.过去两周是否患有其他疾病
function onConfirmSick(vue, data) {
  formRule.initSickCure(vue);
  formRule.initNotCureReason(vue);
  reload(vue, [vue.element.view_sickCure, vue.element.view_notCureReason]);
}
//r33.过去两周是否已就诊或治疗
function onConfirmSickCure(vue, data) {
  formRule.initNotCureReason(vue);
  reload(vue, vue.element.view_notCureReason);
}
//r35.康复服务
function onConfirmRehabilitation(vue) {
  formRule.initNoRehabilitationReason(vue);
  formRule.initRehabilitationNeed(vue);
  reload(vue, [
    vue.element.view_noRehabilitationReason,
    vue.element.view_rehabilitationNeed
  ]);
}
//r41.文化体育
function onConfirmActivity(vue) {
  formRule.initInactivityReason(vue);
  reload(vue, vue.element.view_inactivityReason);
}
//是否集体户口
function onConfirmCollectiveHousehold(vue, data) {
  let v = vue.formData.hostName.value;
  if (data == "1") {
    vue.formData.hostName.value = "集体户口";
  } else {
    if (v) {
      vue.$set(vue.formData.hostName, "value", v.replace(/集体户口?/g, ""));
    }
  }
  formRule.initHouseholder(vue);
  reload(vue, [vue.element.view_hostName, vue.element.view_hostIdentityCard]);
}
//上传图片前
function beforeUpload(vue, file) {
  if (!/^image\/.*$/i.test(file.type)) {
    Toast("请上传图片");
    return false;
  } else {
    return true;
  }
}

//上传图片
function afterUpload(vue, file) {
   file.status = 'uploading';
   file.message = '上传中...';
   let tempFile=file.file;
  photoCompress.compress(tempFile, 0.5, function (base64Codes) {
    var size = file.file.size / 1024 ;//字节转成KB
     if(size>200){
      tempFile= photoCompress.convertBase64ToFile(base64Codes, tempFile.name); 
     }
    uploadImg(vue,tempFile,file);
    
});
}

function uploadImg(vue,file,vantFile){
  const formData = new FormData();  // 声明一个FormData对象
  formData.append("file", file);
  formData.append("identityCard",vue.surveyInfo.disableSurvey.dbc.identityCard);
  _http.post("/disableSurvey/uploadImg",formData,{"Content-Type":"multiple/form-data"}).then(result=>{
    if(result&&result.code==200){
      vue.formData.fileList[0]={ content: result.data.base64 };
      vantFile.status = "done";
      vantFile.message = "上传完成";
    }else{
      vantFile.status = "failed";
      vantFile.message = "上传失败";
    }
  });
}

function deleteImg(vue,file){
  if(file.status=='failed'){
    return true;
  }
  let identityCard=vue.surveyInfo.disableSurvey.dbc.identityCard;
  _http.post("/disableSurvey/delImg/"+identityCard,{},{"Content-Type": "application/x-www-form-urlencoded"}).then(result=>{
    if(result&&result.code==200){
        vue.formData.fileList=[];
    }else{
      Toast.fail("删除失败");
    }
  });
  return false;
}

function reload(vue, obj) {
  if (obj instanceof Array) {
    for (let i = 0, len = obj.length; i < len; i++) {
      vue.$set(obj[i], "flag", false);
      vue.$nextTick(() => vue.$set(obj[i], "flag", true));
    }
  } else {
    vue.$set(obj, "flag", false);
    vue.$nextTick(() => vue.$set(obj, "flag", true));
  }
}

function reloadEconomic(vue) {
  let element = vue.element;
  reload(vue, [element.view_farm, element.view_nonfarm]);
}

function reloadSocialSecurity(vue) {
  let element = vue.element;
  let obj = [
    element.view_socialInsurance,
    element.view_endowmentInsurance,
    element.view_endowmentSubsidy,
    element.view_medicalInsurance,
    element.view_medicalSubsidy,
    element.view_socialAssist,
    element.view_socialWelfare,
    element.view_foster,
    element.view_fosterNeed
  ];
  reload(vue, obj);
}

function reloadHealth(vue) {
  let element = vue.element;
  let obj = [
    element.view_sickCure,
    element.view_notCureReason,
    element.view_rehabilitation,
    element.view_noRehabilitationReason,
    element.view_rehabilitationNeed
  ];
  reload(vue, obj);
}

function reloadJob(vue) {
  let element = vue.element;
  let obj = [
    element.view_employ,
    element.view_employType,
    element.view_unemployedIncome,
    element.view_unemployedReason,
    element.view_employAssist,
    element.view_employAssistNeed
  ];
  reload(vue, obj);
}

function getDisableMultiple(vue) {
  let dbc = vue.surveyInfo.disableSurvey.dbc;
  let disableType = dbc.disableType;
  let disableLevel = dbc.disableLevel;
  let kindstr = dbc.kindstr;
  if (disableType != "7") {
    return disableType + ":" + disableLevel;
  }
  let disableMultiple = "";
  if (kindstr.indexOf("1") >= 0) {
    disableMultiple += "1:" + dbc.eyeLevel + ",";
  }
  if (kindstr.indexOf("2") >= 0) {
    disableMultiple += "2:" + dbc.earLevel+ ",";
  }
  if (kindstr.indexOf("3") >= 0) {
    disableMultiple += "3:" + dbc.speechLevel + ",";
  }
  if (kindstr.indexOf("4") >= 0) {
    disableMultiple += "4:" + dbc.bodyLevel + ",";
  }
  if (kindstr.indexOf("5") >= 0) {
    disableMultiple += "5:" + dbc.iqLevel + ",";
  }
  if (kindstr.indexOf("6") >= 0) {
    disableMultiple += "6:" + dbc.mentalLevel+ ",";
  }
  return disableMultiple;
}

//提交表单
function onSubmit(vue) {
  formRule.setDisabled(vue,vue.element.submit);
  let pstateValue = vue.formData.pstate.value;
  let checkResult = formRule.checkIsFinished_collectInfo(vue);
  if (checkResult) {
    vue.tab_modules="disableCollectInfo";
    Dialog.alert({
      title: checkResult.title,
      message: checkResult.msg,
      theme: "round-button"
    });
    formRule.setDisabled(vue,vue.element.submit,false);
  } else {
    if (pstateValue != "6") {
      excSave(vue);
    } else {
      checkResult = formRule.checkIsFinished(vue);
      if (checkResult) {   
        Dialog.alert({
          title: checkResult.title,
          message: checkResult.msg,
          theme: "round-button"
        });
        formRule.setDisabled(vue,vue.element.submit,false);
      } else {       
        save(vue);
      }
    }
  }
}

function save(vue) {
  let formData = vue.formData;
  let jsonData = {};
  let dbc = vue.surveyInfo.disableSurvey.dbc;
  jsonData["dtype"] = formData.dtype.value; //采集方式
  jsonData["pstate"] = formData.pstate.value; //残疾人情况
  jsonData["sfzh"] = dbc.identityCard;//身份证号
  jsonData["age"]=dbc.age;//年龄
  jsonData["cjlx"] = getDisableMultiple(vue);//残疾类型 
  jsonData["sbr"]=formData.declarant.value;//申报人
  let collector=formData.collector.value;
  let partner=formData.partner.value;
  collector=partner?collector+" "+partner:collector;
  jsonData["updateEmp"]=collector;//采集员
  jsonData["addTime"]=formData.addTime.value;//采集时间
  jsonData["xzqh"]=dbc.areaCode; //行政区划码
  if(vue.surveyInfo.personInfo){
    jsonData["id"]=vue.surveyInfo.personInfo.id;//id
  }
  jsonData["r1"]=dbc.name;//姓名
  jsonData["r2"]=dbc.disableNumber;//残疾证号
  jsonData["r3"]=formData.householdType.value;//户口性质
  jsonData["r4"]=formData.marriage.value;//婚姻状况
  jsonData["r5"]=formData.contactName.value;//联系人姓名
  jsonData["r6_1"]=formData.telephone.value;//固话
  jsonData["r6_2"]=formData.mobilephone.value;//手机号
  jsonData["r7"]=formData.nursingHouse.value;//养老院居住
  jsonData["r8"]=formData.nonfarmEconomy.value;//非农业家庭收入状况
  jsonData["r9"]=formData.nonfarmHousing.value;//非农业家庭住房状况
  jsonData["r10"]=formData.farmEconomy.value;//农业贫困与建档立卡状况
  jsonData["r11"]=formData.farmHousing.value;//农业家庭住房状况
  jsonData["r12"]=formData.literacy.value;//是否识字
  jsonData["r13"]=formData.education.value;//受教育情况
  jsonData["r14"]=formData.generalSchool.value||formData.specialSchool.value;//就读学校
  jsonData["r15"]=formData.notEnrolledReason.value;//未入学主要原因
  jsonData["r16"]=formData.employ.value;//是否就业
  jsonData["r17"]=formData.employType.value;//残疾人就业形式
  jsonData["r18"]=formData.unemployedIncome.value;//未就业主要生活来源
  jsonData["r19"]=formData.unemployedReason.value;//未就业主要原因
  jsonData["r20"]=formData.employAssist.join(",");//就业帮扶
  jsonData["r21"]=formData.employAssistNeed.join(",");//就业扶贫需求
  jsonData["r22"]=formData.socialInsurance.join(",");//职工保险
  jsonData["r23"]=formData.endowmentInsurance.value;//养老保险
  jsonData["r24"]=formData.endowmentSubsidy.value;//养老保险缴费补贴
  jsonData["r25"]=formData.medicalInsurance.value;//医疗保险
  jsonData["r26"]=formData.medicalSubsidy.value;//医疗保险缴费补贴
  jsonData["r27"]=formData.socialAssist.join(",");//社会救助
  jsonData["r28"]=formData.socialWelfare.join(",");//社会福利补贴
  jsonData["r29"]=formData.foster.value;//托养服务
  jsonData["r30"]=formData.fosterNeed.value;//托养服务需求
  jsonData["r31"]=formData.familyDoctor.value;//家庭医生服务协议
  jsonData["r32"]=formData.sick.value;//过去两周是否患有其他疾病
  jsonData["r33"]=formData.sickCure.value;//是否已就诊或治疗
  jsonData["r34"]=formData.notCureReason.join(",");//未就诊或治疗原因
  jsonData["r35"]=formData.rehabilitation.join(",");//得到的康复服务
  jsonData["r36"]=formData.noRehabilitationReason.join(",");//未得到康复服务原因
  jsonData["r37"]=formData.rehabilitationNeed.join(",");//康复服务需求
  jsonData["r38"]=formData.barrierFree.value;//是否进行无障碍改造
  jsonData["r39"]=formData.barrierFreeNeed.join(",");//无障碍改造需求
  jsonData["r40"]=formData.activity.value;//不能经常参加文化体育
  jsonData["r41"]=formData.inactivityReason.join(",");//不能经常参加村组织的文化体育原因
  jsonData["hzxm"]=formData.hostName.value;//户主姓名
  jsonData["hzsfzh"]=formData.hostIdentityCard.value;//户主身份证号
  remote_request(vue,jsonData);
}

function excSave(vue) {
  let formData = vue.formData;
  let dbc = vue.surveyInfo.disableSurvey.dbc;
  let jsonData = {};
  jsonData["dtype"] = formData.dtype.value; //采集方式
  jsonData["pstate"] = formData.pstate.value; //残疾人情况
  jsonData["sfzh"] = dbc.identityCard;//身份证号
  jsonData["age"]=dbc.age;//年龄
  jsonData["cjlx"] = getDisableMultiple(vue);//残疾类型 
  jsonData["sbr"]=formData.declarant.value;//申报人
  let collector=formData.collector.value;
  let partner=formData.partner.value;
  collector=partner?collector+" "+partner:collector;
  jsonData["updateEmp"]=collector;//采集员
  jsonData["addTime"]=formData.addTime.value;//采集时间
  jsonData["xzqh"]=dbc.areaCode; //行政区划码
  if(vue.surveyInfo.personInfo){
    jsonData["id"]=vue.surveyInfo.personInfo.id;//id
  }
  jsonData["r1"]=dbc.name;//姓名
  jsonData["r2"]=dbc.disableNumber;//残疾证号
  remote_request(vue,jsonData);
}

function remote_request(vue,jsonData){
  _http
  .post(
    "/disableSurvey/save",
    jsonData
  )
  .then(result => {
    formRule.setDisabled(vue,vue.element.submit,false);
    if(result&&result.code==200){
      let data=result.data;
      if(!vue.surveyInfo.personInfo){
        vue.surveyInfo.personInfo={};
      }
      vue.$set(vue.surveyInfo.personInfo,"id",data.id);
      Dialog.alert({
        title:"提交成功",
        className:'color-green-0eb956',
        message: '可以在《已采集列表》下面进行查看',
        theme: 'round-button',
        confirmButtonColor:'#0EB956'
      });  
    }else {
      Dialog.alert({
        title:"提交失败！",
        className:'color-red-ee0a24',
        message: result&&result.msg?result.msg:"请求异常",
        theme: 'round-button',
      });
    }
  });
}

export default {
  onChangePstate,
  onChangeHouseholdType,
  onChangeNursingHouse,
  onConfirmMarriage,
  onConfirmNonfarmEconomy,
  onConfirmNonfarmHousing,
  onConfirmFarmEconomy,
  onConfirmFarmHousing,
  onConfirmLiteracy,
  onConfirmEducation,
  onConfirmGeneralSchool,
  onConfirmSpecialSchool,
  onConfirmNotEnrolledReason,
  onConfirmEmploy,
  onConfirmEmployType,
  onConfirmUnemployedIncome,
  onConfirmUnemployedReason,
  onConfirmSocialInsurance,
  onConfirmEndowmentInsurance,
  onConfirmMedicalInsurance,
  onConfirmMedicalSubsidy,
  onConfirmSocialAssist,
  onConfirmSocialWelfare,
  onConfirmFoster,
  onConfirmFosterNeed,
  onConfirmSick,
  onConfirmSickCure,
  onConfirmRehabilitation,
  onConfirmActivity,
  onConfirmCollectiveHousehold,
  beforeUpload,
  afterUpload,
  deleteImg,
  onSubmit
};
